package org.javabasics.io;

import java.io.FileWriter;
import java.io.IOException;
import java.net.URLDecoder;

/**
 * Created by LUOLIANG on 2016/9/21.
 * 使用字符输出流创建文件
 */
public class FileWriterTest {
    public static void main(String[] args) {
        String path = URLDecoder.decode(
                System.getProperty("user.dir") + "/basicsPractice/src/org/javabasics/io/");
        try (FileWriter fw = new FileWriter(path + "poem.txt")) {
            fw.write("好诗啊好诗。\r\n");
            fw.write("123412414");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
